package com.lintf.sharding.sphere.controller;

import com.lintf.business.entity.XxlJobUser;
import com.lintf.sharding.sphere.service.IXxlJobUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/xxlJobUser")
public class XxlJobUserController {

    @Autowired
    private IXxlJobUserService xxlJobUserService;

    @RequestMapping("/save")
    public void save() {
        XxlJobUser xxlJobUser = new XxlJobUser();
        xxlJobUser.setUsername("DEMO");
        xxlJobUser.setPassword("DEMO");
        xxlJobUser.setRole(0);
        if (xxlJobUserService.save(xxlJobUser)) {
            log.debug("请求成功");
        } else
            log.error("请求失败");
    }

}
